Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
The npm package 'html-tags' provides a list of standard HTML tags, which can be used in various JavaScript projects to validate, generate, or manipulate HTML content. It is particularly useful for developers working with templating, HTML parsing, or any form of web content generation where knowing if a string is a valid HTML tag is necessary.
List of all HTML tags
This feature provides an array of all standard HTML tags. It can be used to check if a string is a valid HTML tag, or to iterate over all tags for any purpose such as generating documentation or creating dynamic HTML content.
const htmlTags = require('html-tags');
console.log(htmlTags);
List of void HTML tags
This feature provides an array of HTML tags that do not require a closing tag, known as void elements. Useful for HTML parsing or generation to ensure correct tag handling without closing tags.
const voidHtmlTags = require('html-tags/void');
console.log(voidHtmlTags);
Similar to the void tag list in 'html-tags', this package provides a list of void elements. It is specifically focused on these types of tags, whereas 'html-tags' includes both standard and void tags, offering a broader utility.
While 'html-tags' includes standard HTML tags, 'svg-tags' focuses specifically on tags used within SVG files. This specialization makes it ideal for projects that deal primarily with SVG content, but less versatile compared to 'html-tags' for broader HTML document contexts.
List of standard HTML tags
It's just a couple of JSON files that can be used in any environment.
It intentionally leaves out obsolete tags.
$ npm install html-tags
const htmlTags = require('html-tags');
console.log(htmlTags);
//=> ['a', 'abbr', 'acronym', …]
And void (self-closing) tags:
const voidHtmlTags = require('html-tags/void');
console.log(voidHtmlTags);
//=> ['area', 'base', 'br', …]
Make sure to update types in index.d.ts
when changing HTML elements.
FAQs
List of standard HTML tags
The npm package html-tags receives a total of 8,133,372 weekly downloads. As such, html-tags popularity was classified as popular.
We found that html-tags demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.